public class Submarine {

	public static void main(String[] args) {
		Submarine sub = new Submarine();
		String data = "10010111";
		sub.check(data);
	}

	public void check(String data) {

		if (data.length() > 200) {
			System.out.println("this is not a data");
			return;
		}
		for (int i = 0; i <= data.length() - 1; i++) {
			if (data.charAt(i) == '0') {
				if (data.charAt(i+=1) == '1') {
				} else {
					System.out.println("NOISE");
					return;
				}
			} else if (data.charAt(i) == '1') {
				if (data.charAt(i+=1) == '0') {
					if (data.charAt(i += 1) == '0') {
						do {						
							i++;
							if(i >= (data.length()-1) ){System.out.println("SUBMARINE"); return; }
						} while (data.charAt(i) == '0');
						do {
							
							i++;
							if(i >= (data.length()-1) ){System.out.println("SUBMARINE"); return; }
						} while (data.charAt(i) == '1');
							i++;
						
					} else {
						System.out.println("NOISE");
						return;
					}
				} else {
					System.out.println("NOISE");
					return;
				}
			}
		}
		System.out.println("SUBMARINE");

	}

}
